<?php

class setting_m_analytics extends a_base_model_datamapper {

    public function __construct($id=null) {
        $this->table = 'analytics_settings';
        parent::__construct($id);
    }

    // @TODO: I am pretey sure this function is not supposed to be placed here,
    // if there was any function that i could call in order to receive values from the
    // table 'global_settings' i would not need this function at all
    public function is_tracking_enabled()
    {
        $is_enabled_ga = NULL;

        $this->db->from('global_settings');
        $this->db->select('value');
        $this->db->where('setting_name', 'enable_ga_tracking');
        $query = $this->db->get();

        foreach ($query->result() as $i)
            $is_enabled_ga = $i->value;

        return $is_enabled_ga;
    }


}
?>